# $Id: PKGBUILD 90028 2013-05-06 19:37:00Z foutrelis $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Federico CInelli <cinelli@aur.archlinux.org>
# Contributor: Tom Wambold <tom5760@gmail.com>

pkgname='frogatto'
arch=('i686' 'x86_64')
pkgver=1.3.1
pkgrel=2
pkgdesc="An old-school 2d platformer game, starring a certain quixotic frog"
url="http://www.frogatto.com"
license=('GPL')
depends=('glew' 'sdl' 'sdl_image' 'sdl_ttf' 'sdl_mixer' 'libpng' 'boost-libs' 'frogatto-data')
makedepends=('mesa-libgl' 'boost')
source=("frogatto-$pkgver.tar.gz::https://github.com/frogatto/frogatto/archive/$pkgver.tar.gz"
        frogatto
        frogatto.desktop)
md5sums=('f3206fbe1395ea2878092fbd4ed2c591'
         '9ed2c9ea59e95fe3c0b3ad49e58f8890'
         'e31563b04748a39292a59aaad633ff58')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  sed -i 's/ccache //g' Makefile
  sed -i 's/-lprofiler//g' Makefile
  sed -i 's/\.io_service/\.get_io_service/g' src/server.cpp
  sed -i 's/\%lu\\n/\%zu\\n/g' src/server.cpp
  sed -i 's/-lboost_regex-mt/-lboost_regex/g' Makefile
  sed -i 's/-lboost_system-mt/-lboost_system/g' Makefile
  sed -i 's/-lboost_thread-mt/-lboost_thread/g' Makefile
  sed -i 's/-lboost_iostreams-mt/-lboost_iostreams/g' Makefile
  make game server
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  install -Dm 755 "game" "$pkgdir/opt/frogatto/game"
  install -Dm 755 "server" "$pkgdir/opt/frogatto/server"
  install -Dm 644 "src/LICENSE" "$pkgdir/usr/share/licenses/frogatto/LICENSE"
  install -Dm 755 "$srcdir/frogatto" "$pkgdir/usr/bin/frogatto"
  install -Dm 644 "$srcdir/frogatto.desktop" "$pkgdir/usr/share/applications/frogatto.desktop"
}

# vim:set ts=2 sw=2 et:
